import { http } from '@/utils/http/axios';
const baseUrl = '/user';

export default {
  /**
   * @description 获取用户详情
   * @description 说明 : 登录后调用此接口 , 传入用户 id, 可以获取用户详情
   * @param uid 必选参数
   */
  detail: (uid: string) => http.get({ url: `${baseUrl}/detail`, params: { uid } }, { isTransformResponse: false }),

  /**
   * @description 获取账号信息
   * @description 说明 : 登录后调用此接口 ,可获取用户账号信息
   */
  account: () => http.get({ url: `${baseUrl}/account` }, { isTransformResponse: false }),

  /**
   * @description 获取用户歌单
   * @param limit
   * @param offset
   * @param uid
   * @returns
   */
  playList: (limit: number = 30, offset: number = 0, uid: string) =>
    http.get({ url: `${baseUrl}/playlist`, params: { uid, limit, offset } }, { isTransformResponse: false }),
};
